package com.lfsenior.broker;

import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;

import java.net.URI;

/**
 * Created by dlupan on 2018/11/1
 */
public class InnerFactoryBroker {
    public static void main(String[] args) throws Exception{
        //  通过工厂创建broker
        BrokerService broker = BrokerFactory.createBroker(new URI("properties:broker.properties"));
        //  添加连接地址
        broker.addConnector("tcp://localhost:61616");
        //  启动broker
        broker.start();
    }
}
